package com.hadwinling.blog.service;

import com.hadwinling.blog.entity.Article;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service
 * @date 2020/8/19 22:02
 */
public interface ArticleService {


    int deleteByPrimaryKey(Integer id);

    int insert(Article record);

    int insertSelective(Article record);

    Article selectByPrimaryKey(Integer id);

    int countByState(int state);

    List<Article> selectAllByState(Integer state);

    Article selectAllByStateAndId(Integer state, Integer articleid);

    List<Article> selectAllSelective(Article article);

    //根据adminid获取0-5 的数据
    List<Article> selectAllByAdminid( Integer adminid,Integer limitnum);

    int updateByPrimaryKeySelective(Article record);

    int updateByPrimaryKey(Article record);

    List<Article> selectAllByStateAndTop(Integer state, Integer top);

    List<Article> selectAllByStateAndTagid(Integer state, Integer tagid);

    int updateTopById(Integer updatedTop, Integer id);

    List<Article> selectAllByStateAndTagidAndAdminId(Integer state, Integer tagid,Integer adminid);

    List<Article> selectAllByAdminidAndState(Integer adminid, Integer state);

    List<Article> selectAllByAdminIdAndTitleAndTag(Article article);

    List<Article> selectAllByStateAndTagidAndLimit(Integer state, Integer tagid,Integer limitnum);

    int countLikeById(Integer adminid);

    List<Article> selectAllByStateOrderByCreatetimeDesc(Integer state);
}


